<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: Wickr_ephemeral_keypair</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wickr_ephemeral_keypair</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a key pair used for message key exchanges within the Wickr Messaging Protocol.  <a href="structwickr__ephemeral__keypair.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab956214203938b4b02b8f30666eaec3b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#gab956214203938b4b02b8f30666eaec3b">wickr_ephemeral_keypair_create</a> (uint64_t identifier, <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *ec_key, <a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *signature)</td></tr>
<tr class="separator:gab956214203938b4b02b8f30666eaec3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacf14f050221091093b9a2948bd569662"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#gacf14f050221091093b9a2948bd569662">wickr_ephemeral_keypair_copy</a> (const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *source)</td></tr>
<tr class="separator:gacf14f050221091093b9a2948bd569662"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6c0935c579e3d4bdbfeada7cb60c2a1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#ga6c0935c579e3d4bdbfeada7cb60c2a1b">wickr_ephemeral_keypair_generate_identity</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, uint64_t identifier, const <a class="el" href="structwickr__identity.html">wickr_identity_t</a> *identity)</td></tr>
<tr class="separator:ga6c0935c579e3d4bdbfeada7cb60c2a1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc17110d4c7fa65a9456fae516bf2e5d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#gadc17110d4c7fa65a9456fae516bf2e5d">wickr_ephemeral_keypair_verify_owner</a> (const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *keypair, const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__identity.html">wickr_identity_t</a> *owner)</td></tr>
<tr class="separator:gadc17110d4c7fa65a9456fae516bf2e5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2e2f8db184aa2972ef5423e9c03988e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#ga2e2f8db184aa2972ef5423e9c03988e8">wickr_ephemeral_keypair_make_public</a> (const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *keypair)</td></tr>
<tr class="separator:ga2e2f8db184aa2972ef5423e9c03988e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c994a08f270cc84088263d48a4b3636"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#ga1c994a08f270cc84088263d48a4b3636">wickr_ephemeral_keypair_serialize</a> (const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *keypair)</td></tr>
<tr class="separator:ga1c994a08f270cc84088263d48a4b3636"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ecd3769c68ba5bfbc95a225c1021ed0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#ga7ecd3769c68ba5bfbc95a225c1021ed0">wickr_ephemeral_keypair_create_from_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer, const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine)</td></tr>
<tr class="separator:ga7ecd3769c68ba5bfbc95a225c1021ed0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab77107c0b1a0d145c606817eeecec63d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__ephemeral__keypair.html#gab77107c0b1a0d145c606817eeecec63d">wickr_ephemeral_keypair_destroy</a> (<a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> **keypair)</td></tr>
<tr class="separator:gab77107c0b1a0d145c606817eeecec63d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="gacf14f050221091093b9a2948bd569662"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf14f050221091093b9a2948bd569662">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a>* wickr_ephemeral_keypair_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy an ephemeral keypair</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the ephemeral key pair to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated ephemeral key pair holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="gab956214203938b4b02b8f30666eaec3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab956214203938b4b02b8f30666eaec3b">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a>* wickr_ephemeral_keypair_create </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>identifier</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>ec_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *&#160;</td>
          <td class="paramname"><em>signature</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create an Ephemeral Keypair from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">identifier</td><td>the numerical identifier of the keypair </td></tr>
    <tr><td class="paramname">ec_key</td><td>an Elliptic Curve public keypair </td></tr>
    <tr><td class="paramname">signature</td><td>a signature of the public key material in 'ec_key' by the owner of this key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated Ephemeral Keypair, owning the properties that were passed in </dd></dl>

</div>
</div>
<a id="ga7ecd3769c68ba5bfbc95a225c1021ed0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7ecd3769c68ba5bfbc95a225c1021ed0">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_create_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a>* wickr_ephemeral_keypair_create_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create an ephemeral keypair from a buffer that was created with 'wickr_ephemeral_keypair_serialize'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>the buffer that contains a serialized representation of an identity chain </td></tr>
    <tr><td class="paramname">engine</td><td>the crypto engine to use to import the key components of the ephemeral keypair </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>deserialized ephemeral keypair or null if the deserialization fails </dd></dl>

</div>
</div>
<a id="gab77107c0b1a0d145c606817eeecec63d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab77107c0b1a0d145c606817eeecec63d">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_ephemeral_keypair_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> **&#160;</td>
          <td class="paramname"><em>keypair</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy an ephemeral keypair</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keypair</td><td>a pointer to the key pair to destroy. All properties of '*keypair' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6c0935c579e3d4bdbfeada7cb60c2a1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6c0935c579e3d4bdbfeada7cb60c2a1b">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_generate_identity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a>* wickr_ephemeral_keypair_generate_identity </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>identifier</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity.html">wickr_identity_t</a> *&#160;</td>
          <td class="paramname"><em>identity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a new ephemeral key pair given an owner identity.</p>
<p>This method will use the 'default_curve' property of the crypto engine provided as the curve for the resulting keypair</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>crypto engine supporting random Elliptic Curve generation, and ECDSA signatures </td></tr>
    <tr><td class="paramname">identifier</td><td>the identifier to assign to the generated output keypair </td></tr>
    <tr><td class="paramname">identity</td><td>the identity to sign the generated output key pair with </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly generated random Elliptic Curve key pair with identifier 'identifier' and a signature using the 'sig_key' property of the identity provided as the signing key </dd></dl>

</div>
</div>
<a id="ga2e2f8db184aa2972ef5423e9c03988e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2e2f8db184aa2972ef5423e9c03988e8">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_make_public()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_ephemeral_keypair_make_public </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td>
          <td class="paramname"><em>keypair</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy the private components of the keypair</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keypair</td><td>the key pair to make public </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1c994a08f270cc84088263d48a4b3636"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c994a08f270cc84088263d48a4b3636">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_ephemeral_keypair_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td>
          <td class="paramname"><em>keypair</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize an ephemeral keypair to bytes</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keypair</td><td>the ephemeral keypair to serialize </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing a serialized representation of 'keypair' or null if serialization fails </dd></dl>

</div>
</div>
<a id="gadc17110d4c7fa65a9456fae516bf2e5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc17110d4c7fa65a9456fae516bf2e5d">&#9670;&nbsp;</a></span>wickr_ephemeral_keypair_verify_owner()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wickr_ephemeral_keypair_verify_owner </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__ephemeral__keypair.html">wickr_ephemeral_keypair_t</a> *&#160;</td>
          <td class="paramname"><em>keypair</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity.html">wickr_identity_t</a> *&#160;</td>
          <td class="paramname"><em>owner</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Verify the owner of an ephemeral key pair is a particular identity</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keypair</td><td>the key pair to verify the owner of </td></tr>
    <tr><td class="paramname">engine</td><td>a crypto engine that supports verifying signatures generated with the curve associated with the 'sig_key' property of owner </td></tr>
    <tr><td class="paramname">owner</td><td>the proposed owner of this keypair </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the signature of key pair can be verified with the sig_key of owner </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
